package game.roles.visual;

import java.awt.*;

/**
 * @author liuyulai
 * Created with IntelliJ IDEA.
 * Date: 21.5.7
 * Time: 9:31
 * Description: 地图
 */
public class BackgroundMaps {
    public static Image mapImg;
    /**
     * 地图移动与角色移动绑定
     */
    public static int mapX;

    public static boolean mapMoveOrNot = true;

    /**
     * 绘制地图
     *
     * @param graphics 传入画笔
     */
    public void drawFrame(Graphics graphics) {
        if (BackgroundMaps.mapMoveOrNot) {
            mapX -= 1;
        }
        //绘制
        if (mapX < -4200) {
            mapX = -4200;
        }
        //将图片画入内存之中
        graphics.drawImage(mapImg, mapX, 0, null);
    }
}
